package model;

import java.io.Serializable;

/**
 * This class represents a recommendation.
 * 
 * @author Rylie Nelson, Eric Preston
 */
public class Recommendation implements Serializable {
	
	/**
	 * The serial ID.
	 */
	private static final long serialVersionUID = 8257358348116484329L;

	/**
	 * The numerical rating from 1 to 5 (5 = strong accept, 1 = strong reject)
	 */
	private int rating;
	
	/**
	 * The rational for the rating given.
	 */
	private String reason;
	
	/**
	 * The name of the person providing the recommendation
	 */
	private User recommender;
	
	/**
	 * constructor for a recommendation
	 * @param the_rating the summary recommendation rating
	 * @param the_reason the summary recommendation reasoning for the rating given
	 * @param the_recommender the person providing the recommendation
	 */
	public Recommendation(int the_rating, String the_reason, User the_recommender) {
		rating = the_rating;
		reason = the_reason;
		recommender = the_recommender;
	}
	
	/**
	 * Set the rating
	 * @param the_rating the number that the rating will be set to
	 */
	public void setRating(int the_rating) {
		rating = the_rating;
	}
	
	/**
	 * Set the reason
	 * @param the_reason the rationale for the rating given
	 */
	public void setReason(String the_reason) {
		reason = the_reason;
	}
	
	/**
	 * Set the name of the user who is providing this recommendation
	 * @param the_recommender the name of the user who is providing this recommendation
	 */
	public void setRecommender(User the_recommender) {
		recommender = the_recommender;
	}
	
	/**
	 * Returns the rating from this recommendation
	 * @return the rating from this recommendation
	 */
	public int getRating() {
		return rating;
	}
	
	/**
	 * Returns the rationale for the rating for this recommendation
	 * @return the rationale for the rating for this recommendation
	 */
	public String getReason() {
		return reason;
	}
	
	/**
	 * Returns the user who has provided this recommendation
	 * @return the user who has provided this recommendation
	 */
	public User getRecommender() {
		return recommender;
	}
}
